package com.ftg.learn.day15.interfacexml;

import com.ftg.learn.day15.interfacexml.domain.DeptDomain;
import com.ftg.learn.day15.interfacexml.mapper.DeptMapper;
import com.ftg.learn.day15.interfacexml.util.MapperUtil;


import java.io.IOException;

/**
 * @author 布衣
 */
public class Play {

    public static void main(String[] args) {
        MapperUtil mapperUtil = new MapperUtil("mybatis1/zong.xml");
        try {
            DeptMapper deptmapper = mapperUtil.getMapper(DeptMapper.class);
            deptmapper.insert(new DeptDomain(10,"java","北京"));
            deptmapper.insert1(11,"java","北京");
            deptmapper.showAll();
            mapperUtil.myCommit();
        } catch (IOException e) {
            mapperUtil.myRollback();
            throw new RuntimeException(e);
        }finally {
            mapperUtil.myClose();
        }
    }

}
